package com.example.barcodeapp.ui.wode.activity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

import androidx.appcompat.widget.Toolbar;
import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import com.example.barcodeapp.R;
import com.example.barcodeapp.base.BaseActivity;
import com.example.barcodeapp.interfaces.own.IOwn;
import com.example.barcodeapp.persenter.OnePresenterJiFengBiJiLu;
import com.example.barcodeapp.ui.wode.adapter.JiFeengBiJiLuAdapter;
import com.example.barcodeapp.ui.wode.bean.JiFengBiJiLuBean;

import butterknife.BindView;
import butterknife.ButterKnife;

public class WoDeYuEActivity extends BaseActivity<IOwn.Persenterjifengbi> implements IOwn.Viewjifengbi {


    @BindView(R.id.iv_back_circle)
    ImageView ivBackCircle;
    @BindView(R.id.ff_back_contener)
    FrameLayout ffBackContener;
    @BindView(R.id.iv_back)
    ImageView ivBack;
    @BindView(R.id.tv_location)
    TextView tvLocation;
    @BindView(R.id.tv_title)
    TextView tvTitle;
    @BindView(R.id.ll_to_search)
    LinearLayout llToSearch;
    @BindView(R.id.right_iv)
    ImageView rightIv;
    @BindView(R.id.right_iv_two)
    ImageView rightIvTwo;
    @BindView(R.id.tv_rught_)
    TextView tvRught;
    @BindView(R.id.tv_right_two)
    TextView tvRightTwo;
    @BindView(R.id.toolBar)
    Toolbar toolBar;
    @BindView(R.id.linearLayout9)
    LinearLayout linearLayout9;
    @BindView(R.id.textView38)
    TextView textView38;
    @BindView(R.id.textView39)
    TextView textView39;
    @BindView(R.id.jifengbichongzhi)
    TextView jifengbichongzhi;
    @BindView(R.id.constraintLayout9)
    ConstraintLayout constraintLayout9;
    @BindView(R.id.textView52)
    TextView textView52;
    @BindView(R.id.textView54)
    TextView textView54;
    @BindView(R.id.jifengbijilu_rv)
    RecyclerView jifengbijiluRv;

    @Override
    protected int getLayout() {
        return R.layout.wodeyue_activity;
    }

    @Override
    protected void initView() {
        setToolBar(true, false, true, false, false);
        setTitle("余额", R.color.black, R.color.white);
        Intent intent = getIntent();
        String yuee = intent.getStringExtra("yuee");
        textView39.setText(yuee + ".00");
        jifengbichongzhi.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent = new Intent(WoDeYuEActivity.this, JiFengBiChongZhiActivity.class);
                startActivity(intent);
            }
        });
    }

    @Override
    protected OnePresenterJiFengBiJiLu initPersenter() {

        return new OnePresenterJiFengBiJiLu();

    }

    @Override
    protected void initData() {

        persenter.getjifengbi(1);
    }

    @Override
    public void getjifengbi(JiFengBiJiLuBean xiLieKeBean) {
        JiFeengBiJiLuAdapter jiFeengBiJiLuAdapter = new JiFeengBiJiLuAdapter(this,xiLieKeBean.getData());
        jifengbijiluRv.setLayoutManager(new LinearLayoutManager(this));
        jifengbijiluRv.setAdapter(jiFeengBiJiLuAdapter);
        jiFeengBiJiLuAdapter.notifyDataSetChanged();
    }


}
